package ${package}.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import ${package}.repository.I${className}DAO;
import ${package}.entity.${className}Entity;
import ${package}.service.I${className}Service;

/**
* <p>Discription:[${info}服务接口实现类]</p>
* Created on ${date}
* @author ${uname}
*/
@Service("${classNameLower}Service")
public class ${className}ServiceImpl implements I${className}Service {


@Resource
private I${className}DAO ${classNameLower}DAO;


/**
* <p>Discription:[通过ID编号查询${info}]</p>
* Created on ${date}
* @param id ID编号
* @return ${className} ${info}
* @author:${uname}
*/
@Override
public ${className}Entity selectById(Integer id) {
return ${classNameLower}DAO.selectById(id);
}

/**
* <p>Discription:[添加${info}]</p>
* Created on ${date}
* @param ${classNameLower} ${info}
* @return ${className} ${info}
* @author:${uname}
*/
@Override
public ${className}Entity insert(${className}Entity ${classNameLower}) {
${classNameLower}DAO.insert(${classNameLower});
return ${classNameLower};
}

/**
* <p>Discription:[修改${info}]</p>
* Created on ${date}
* @param ${classNameLower} ${info}
* @return Boolean 执行结果
* @author:${uname}
*/
@Override
public Boolean update(${className}Entity ${classNameLower}) {
try {
${classNameLower}DAO.update(${classNameLower});
return true;
} catch (Exception e) {
return false;
}
}

/**
* <p>Discription:[根据IDS批量删除${info}]</p>
* Created on ${date}
* @param ids ID编号数组
* @return Boolean 执行结果
* @author:${uname}
*/
@Override
public Boolean deleteByIds(String[] ids) {
try {
${classNameLower}DAO.deleteByIds(ids);
return true;
} catch (Exception e) {
return false;
}
}

/**
* <p>Discription:[删除${info}]</p>
* Created on ${date}
* @param id ID编号
* @return Boolean 执行结果
* @author:${uname}
*/
@Override
public Boolean deleteById(Integer id) {
try {
${classNameLower}DAO.delete(id);
return true;
} catch (Exception e) {
return false;
}
}
}